package greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import greendao.entity.ProtectMeasures;
import greendao.entity.Safety;
import greendao.entity.SecurityRisk;
import greendao.entity.UnitInformation;
import greendao.entity.User;

import greendao.ProtectMeasuresDao;
import greendao.SafetyDao;
import greendao.SecurityRiskDao;
import greendao.UnitInformationDao;
import greendao.UserDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig protectMeasuresDaoConfig;
    private final DaoConfig safetyDaoConfig;
    private final DaoConfig securityRiskDaoConfig;
    private final DaoConfig unitInformationDaoConfig;
    private final DaoConfig userDaoConfig;

    private final ProtectMeasuresDao protectMeasuresDao;
    private final SafetyDao safetyDao;
    private final SecurityRiskDao securityRiskDao;
    private final UnitInformationDao unitInformationDao;
    private final UserDao userDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        protectMeasuresDaoConfig = daoConfigMap.get(ProtectMeasuresDao.class).clone();
        protectMeasuresDaoConfig.initIdentityScope(type);

        safetyDaoConfig = daoConfigMap.get(SafetyDao.class).clone();
        safetyDaoConfig.initIdentityScope(type);

        securityRiskDaoConfig = daoConfigMap.get(SecurityRiskDao.class).clone();
        securityRiskDaoConfig.initIdentityScope(type);

        unitInformationDaoConfig = daoConfigMap.get(UnitInformationDao.class).clone();
        unitInformationDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        protectMeasuresDao = new ProtectMeasuresDao(protectMeasuresDaoConfig, this);
        safetyDao = new SafetyDao(safetyDaoConfig, this);
        securityRiskDao = new SecurityRiskDao(securityRiskDaoConfig, this);
        unitInformationDao = new UnitInformationDao(unitInformationDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);

        registerDao(ProtectMeasures.class, protectMeasuresDao);
        registerDao(Safety.class, safetyDao);
        registerDao(SecurityRisk.class, securityRiskDao);
        registerDao(UnitInformation.class, unitInformationDao);
        registerDao(User.class, userDao);
    }
    
    public void clear() {
        protectMeasuresDaoConfig.clearIdentityScope();
        safetyDaoConfig.clearIdentityScope();
        securityRiskDaoConfig.clearIdentityScope();
        unitInformationDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
    }

    public ProtectMeasuresDao getProtectMeasuresDao() {
        return protectMeasuresDao;
    }

    public SafetyDao getSafetyDao() {
        return safetyDao;
    }

    public SecurityRiskDao getSecurityRiskDao() {
        return securityRiskDao;
    }

    public UnitInformationDao getUnitInformationDao() {
        return unitInformationDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

}
